export default {
  state: {
    // 设置actionCollction的store编码，便于通过编码调用collection的方法
    actionsCode: 'actions'
  },
  actions: {
    actionCall({dispatch, state}, data) {
      return dispatch(`${state.actionsCode}/actionCall`, data)
    },
    actionDispath({dispatch, state},{code, data}) {
      return dispatch(`${state.actionsCode}/${code}`, data)
    }
  },
  mutations: {
    setActionsCode(state, code) {
      state.actionsCode = code
    }
  }
}
